use neon::prelude::*;

extern crate rsa;
extern crate crypto;

mod jwt;

use jwt::new_token;

fn hello(mut cx: FunctionContext) -> JsResult<JsString> {
    Ok(cx.string("hello node"))
}

fn func(mut cx: FunctionContext) -> JsResult<JsString> {
    // print!("cx: {:#?}", cx.arguments);

    let s: Handle<JsString> = cx.argument(0)?;

    new_token();

    Ok(s)
}

#[neon::main]
fn main(mut cx: ModuleContext) -> NeonResult<()> {
    cx.export_function("hello", hello)?;
    cx.export_function("func", func)?;
    Ok(())
}
